home *** CD-ROM | disk | FTP | other *** search
/ Strategy Challenges Collection / Strategy Challenges Collection.iso / mac / DemoData / NumberH.Dxr / 00003_Main_Movie_Script.ls < prev    next >
Encoding:
Text File  |  1996-10-04  |  3.0 KB  |  126 lines

  1. on _GoBack vFrame, VMovie
  2.   sound stop 1
  3.   sound stop 2
  4.   leaveDemo()
  5. end
  6.  
  7. on FadeMyVolume theChannel, theTime, theGrain, theLevelMac, theLevelPC
  8.   if machineType() < 255 then
  9.     set theLevel to theLevelMac
  10.   else
  11.     set theLevel to theLevelPC
  12.   end if
  13.   puppetTempo(theTime)
  14.   if theChannel = 3 then
  15.     repeat while (the volume of sound 1 > theLevel) or (the volume of sound 2 > theLevel)
  16.       if the volume of sound 1 > theLevel then
  17.         set the volume of sound 1 to the volume of sound 1 - theGrain
  18.       end if
  19.       if the volume of sound 2 > theLevel then
  20.         set the volume of sound 2 to the volume of sound 2 - theGrain
  21.       end if
  22.       pWait(theTime)
  23.     end repeat
  24.     if theLevel = 0 then
  25.       sound stop 1
  26.       sound stop 2
  27.     end if
  28.   else
  29.     repeat while the volume of sound theChannel > theLevel
  30.       set the volume of sound theChannel to the volume of sound theChannel - theGrain
  31.       pWait(theTime)
  32.     end repeat
  33.     if theLevel = 0 then
  34.       sound stop theChannel
  35.     end if
  36.   end if
  37. end
  38.  
  39. on setMyVolume theChannel, theMacVol, thePCVol
  40.   if machineType() < 255 then
  41.     set the volume of sound theChannel to theMacVol
  42.   else
  43.     set the volume of sound theChannel to thePCVol
  44.   end if
  45. end
  46.  
  47. on pWait theSecs
  48.   set tmpTicks to the ticks
  49.   repeat while the ticks < (tmpTicks + (theSecs * 60))
  50.     if the mouseDown then
  51.       set vMouseCast to the mouseCast
  52.       if vMouseCast > 1 then
  53.         if the name of cast the mouseCast = "Edmark.BTN" then
  54.           exit
  55.         end if
  56.       end if
  57.     end if
  58.     if (the commandDown and (the key = "Q")) or (the commandDown and (the key = ".")) then
  59.       exit
  60.     end if
  61.   end repeat
  62. end
  63.  
  64. on waitSound theChannel
  65.   repeat while soundBusy(theChannel)
  66.     if the mouseDown then
  67.       set vMouseCast to the mouseCast
  68.       if vMouseCast > 1 then
  69.         if the name of cast the mouseCast = "Edmark.BTN" then
  70.           exit
  71.         end if
  72.       end if
  73.     end if
  74.     if (the commandDown and (the key = "Q")) or (the commandDown and (the key = ".")) then
  75.       exit
  76.     end if
  77.   end repeat
  78. end
  79.  
  80. on _waitSound theChannel
  81.   repeat while soundBusy(theChannel)
  82.     if the mouseDown then
  83.       set vMouseCast to the mouseCast
  84.       if vMouseCast > 1 then
  85.         if the name of cast the mouseCast = "Edmark.BTN" then
  86.           exit
  87.         end if
  88.       end if
  89.     end if
  90.     if (the commandDown and (the key = "Q")) or (the commandDown and (the key = ".")) then
  91.       exit
  92.     end if
  93.   end repeat
  94. end
  95.  
  96. on LoopOnSound theChannel, theMarker
  97.   set mm to theMarker
  98.   set cc to theChannel
  99.   if value(mm) = EMPTY then
  100.     if soundBusy(cc) then
  101.       go(mm)
  102.     end if
  103.   else
  104.     if soundBusy(cc) then
  105.       go(marker(mm))
  106.     end if
  107.   end if
  108. end
  109.  
  110. on LoopOnTime theSeconds, theMarker
  111.   global tempTimer
  112.   set mm to theMarker
  113.   set ss to theSeconds
  114.   if tempTimer > 0 then
  115.     if tempTimer < the ticks then
  116.       go(the frame + 1)
  117.       set tempTimer to 0
  118.     else
  119.       go(marker(mm))
  120.     end if
  121.   else
  122.     set tempTimer to the ticks + (theSeconds * 60)
  123.     go(marker(mm))
  124.   end if
  125. end
  126.